package com.team233.zuccecho.repository;

import com.team233.zuccecho.Bean.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

@Repository
public interface TeacherRepository extends JpaRepository<Teacher,Integer> {
    @Query(value="select * from teacher where teacher_id=?1",nativeQuery = true)
    Teacher findTeaById(String tea_id);

    @Transactional
    @Modifying
    @Query(value="update teacher set teacher_pwd=?1 where teacher_id=?2",nativeQuery = true)
    int ModifyPwd(String newpwd,String tea_id);

}
